package com.sgb.kjwl.view.ui.adapter.transport;


import android.content.Context;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.self.GoodsSourceDetail;
import com.sgb.kjwl.model.entity.transport.GoodsOfferUnits;
import com.sgb.kjwl.model.entity.transport.GoodsSourcePlace;
import com.sgb.kjwl.model.entity.transport.SingleItemConstant;
import com.sgb.kjwl.model.entity.transport.common.AddressItem;
import com.sgb.kjwl.utils.CargoConstant;
import com.sgb.kjwl.utils.DefaultUtil;
import com.sgb.kjwl.utils.NumberUtil;
import com.sgb.kjwl.view.ui.activity.transport.HandleAdressActivity;
import com.swgk.core.customview.SeeMoreView;
import com.swgk.core.util.ArrayUtil;
import com.swgk.core.util.DateUtils;
import com.swgk.core.util.SharedPreferenceUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author : 熊丽
 * @date :2021/3/1 0001$ 16:45$
 * @Description :$
 */
public class GeneralPrjDetailAdapter extends BaseMultiItemQuickAdapter<GoodsSourceDetail,BaseViewHolder> implements GoodsDetailAddressAdapter.ItemOnClickListen {
    private String TAG="TestAdapter";
    private GoodsDetailAddressAdapter mAdapter;
    private Context mContext;
    private ItemOnClickListen mItemOnClickListen;
    private GoodsSourceDetail mGoodsSourceDetail;
    private List<GoodsOfferUnits> mList = new ArrayList<>();
    private boolean isOwner=false;
    private BiddingUnitAdapter mBiddingUnitAdapter;
    private boolean IsPersonalCenter;
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public GeneralPrjDetailAdapter(Context context, List<GoodsSourceDetail> data,boolean IsPersonalCenter) {
        super(data);
        addItemType(SingleItemConstant.TYPE_ONE, R.layout.general_information_item);
        addItemType(SingleItemConstant.TYPE_TWO, R.layout.vehicle_requirements_item);
        //receipt
        addItemType(SingleItemConstant.TYPE_THREE, R.layout.freight_requirements_item);
        addItemType(SingleItemConstant.TYPE_FOUR, R.layout.payment_agreement_item);
        addItemType(SingleItemConstant.TYPE_FIVE, R.layout.activity_source_details_info);
        this.mContext = context;
        this.mGoodsSourceDetail=data.get(0);
        this.IsPersonalCenter = IsPersonalCenter;
    }
    public void SetItemOnClickListen(ItemOnClickListen item){
        this.mItemOnClickListen = item;
    }
    @Override
    protected void convert(BaseViewHolder helper, GoodsSourceDetail item) {
        if (item==null)return;
        switch (item.getItemType()){
            case SingleItemConstant.TYPE_ONE:
                setFreightItem(item,helper);
                break;
            case SingleItemConstant.TYPE_TWO:
                setVehicleRq(item,helper);
                break;
            case SingleItemConstant.TYPE_THREE:
                setFreightRq(item,helper);
                break;
            case SingleItemConstant.TYPE_FOUR:
                setPaymentAgrement(item,helper);
                break;
            case SingleItemConstant.TYPE_FIVE:
                mList=item.getGoodsOfferUnits();
                String companyNo = SharedPreferenceUtil.getInstance().getSaveStringData(SharedPreferenceUtil.COMPANY_NO, "");
                String userNo = SharedPreferenceUtil.getInstance().getSaveStringData(SharedPreferenceUtil.USER_NO, "");
                if (companyNo.equals(item.getCompanyNo())||companyNo.equals(item.getTeamNo())||userNo.equals(item.getUserNo())){
                    isOwner = true;
                }else {
                    isOwner= false;
                }
                initBiddingView(helper,isOwner);
                break;
        }
    }
    private void setFreightItem(GoodsSourceDetail goodsSourceDetail,BaseViewHolder helper){
         List<AddressItem> items = new ArrayList<>();
         if(goodsSourceDetail.getPlace()!=null){
             initSettingItem(items,goodsSourceDetail.getPlace(),goodsSourceDetail.getHandleTypeNo());
             mAdapter = new GoodsDetailAddressAdapter(items,goodsSourceDetail.getPlace());
             mAdapter.SetItemOnClickListen(this);
             RecyclerView recyclerView = helper.itemView.findViewById(R.id.rl_address);
             recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
             recyclerView.setAdapter(mAdapter);
         }

         if (TextUtils.isEmpty(goodsSourceDetail.getMessagePrice()) || NumberUtil.trim0(goodsSourceDetail.getMessagePrice()).equals("0")) {
             helper.setVisible(R.id.info_fee, false);
         } else {
             helper.setVisible(R.id.info_fee, true);
             helper.setText(R.id.info_fee, Html.fromHtml("<font size='12px' >信息费：</font>" + ("<font  size='20px'>" + messagePrice(goodsSourceDetail) + "元" + "</font>")));
         }
        helper.setText(R.id.info_freight,Html.fromHtml("<font size='12px' >运费合计：</font>" + ("<font  size='20px'>" + allFreight(helper,goodsSourceDetail) + "</font>")));
        helper.setText(R.id.dingjia_type,"承运方式："+(TextUtils.isEmpty(goodsSourceDetail.getPricingType())?"/":goodsSourceDetail.getPricingType()));
        if (!TextUtils.isEmpty(goodsSourceDetail.getHandleTypeName())){
            helper.setText(R.id.load_model,"装卸方式："+goodsSourceDetail.getHandleTypeName());
            helper.setVisible(R.id.load_model,true);
        }else {
            helper.setVisible(R.id.load_model,false);
        }
        if (goodsSourceDetail.getFreightType()!=null&&goodsSourceDetail.getFreightType()==1){
            helper.getView(R.id.total_value).setVisibility(View.GONE);
        }
        if ("1".equals(goodsSourceDetail.getWhetherShow())){
            helper.getView(R.id.owner_information).setVisibility(View.VISIBLE);
        }else {
            helper.getView(R.id.owner_information).setVisibility(View.GONE);
        }
        helper.setText(R.id.tv_owner_unit_title_text,TextUtils.isEmpty(goodsSourceDetail.getShipperOwnerUnit())?"/":goodsSourceDetail.getShipperOwnerUnit());
        helper.setText(R.id.tv_owner_contact_title_text,TextUtils.isEmpty(goodsSourceDetail.getShipperContact())?"/":goodsSourceDetail.getShipperContact());
        helper.setText(R.id.tv_owner_contact_number_title_text,TextUtils.isEmpty(goodsSourceDetail.getShipperPhone())?"/":goodsSourceDetail.getShipperPhone());
    }
    private String setFreightUnit(BaseViewHolder helper,Integer freightUnit){
        String string = "";
        if (freightUnit==null){
            helper.getView(R.id.total_value).setVisibility(View.GONE);
            return "";
        }
         if (freightUnit==1){
             helper.getView(R.id.total_value).setVisibility(View.GONE);
                    string="元";
                }else if (freightUnit==2){
                    string="元";
                }else if (freightUnit==3){
                    string="元";
                }else {
            string="";
        }
                return string;
    }
    private String messagePrice(GoodsSourceDetail goodsSourceDetail){
        return goodsSourceDetail.getMessagePrice()==null?"0": NumberUtil.trim0(goodsSourceDetail.getMessagePrice());
    }
    private String allFreight(BaseViewHolder helper,GoodsSourceDetail goodsSourceDetail){
        return goodsSourceDetail.getFreightType()==null||goodsSourceDetail.getFreightType()==0? (goodsSourceDetail.getAllFreight()==null||goodsSourceDetail.getFreightUnit()==null?"0": NumberUtil.trim0(goodsSourceDetail.getAllFreight()) + setFreightUnit(helper,goodsSourceDetail.getFreightUnit())):goodsSourceDetail.getFreightTypeWorlds();
    }
    /**
     * 初始化功能列表
     */
    public void initSettingItem( List<AddressItem> list, GoodsSourcePlace mgoodsSourcePkace,String handleTypeNo) {
        if (list == null) return;
        list.clear();
        if ("11".equals(handleTypeNo)){//一装一卸
            list.add(new AddressItem(mgoodsSourcePkace.getProvinceName()+"  "+mgoodsSourcePkace.getCityName()+"  "+mgoodsSourcePkace.getDistrictName(),mgoodsSourcePkace.getDetailAddress(),mgoodsSourcePkace.getFirstDistance(),true, R.mipmap.icon_load_goods,handleTypeNo,0));
            list.add(new AddressItem(mgoodsSourcePkace.getDestProvinceName()+"  "+mgoodsSourcePkace.getDestCityName()+"  "+mgoodsSourcePkace.getDestDistrictName(),mgoodsSourcePkace.getDestDetailAddress(),null,false, R.mipmap.icon_unload_goods,handleTypeNo,1));
        }else if ("12".equals(handleTypeNo)){//一装两卸
            list.add(new AddressItem(mgoodsSourcePkace.getProvinceName()+"  "+mgoodsSourcePkace.getCityName()+"  "+mgoodsSourcePkace.getDistrictName(),mgoodsSourcePkace.getDetailAddress(),mgoodsSourcePkace.getFirstDistance(),true, R.mipmap.icon_load_goods,handleTypeNo,0));
            list.add(new AddressItem(mgoodsSourcePkace.getViaDestProvinceName()+"  "+mgoodsSourcePkace.getViaDestCityName()+"  "+mgoodsSourcePkace.getViaDestDistrictName(),mgoodsSourcePkace.getViaDestDetailAddress(),mgoodsSourcePkace.getSecondDistance(),true, R.mipmap.icon_unload_one,handleTypeNo,1));
            list.add(new AddressItem(mgoodsSourcePkace.getDestProvinceName()+"  "+mgoodsSourcePkace.getDestCityName()+"  "+mgoodsSourcePkace.getDestDistrictName(),mgoodsSourcePkace.getDestDetailAddress(),null,false, R.mipmap.icon_unload_two,handleTypeNo,2));
        }else if ("21".equals(handleTypeNo)){//两装一卸
            list.add(new AddressItem(mgoodsSourcePkace.getProvinceName()+"  "+mgoodsSourcePkace.getCityName()+"  "+mgoodsSourcePkace.getDistrictName(),mgoodsSourcePkace.getDetailAddress(),mgoodsSourcePkace.getFirstDistance(),true, R.mipmap.icon_load_one,handleTypeNo,0));
            list.add(new AddressItem(mgoodsSourcePkace.getViaSendProvinceName()+"  "+mgoodsSourcePkace.getViaSendCityName()+"  "+mgoodsSourcePkace.getViaSendDistrictName(),mgoodsSourcePkace.getViaSendDetailAddress(),mgoodsSourcePkace.getSecondDistance(),true, R.mipmap.icon_load_two,handleTypeNo,1));
            list.add(new AddressItem(mgoodsSourcePkace.getDestProvinceName()+"  "+mgoodsSourcePkace.getDestCityName()+"  "+mgoodsSourcePkace.getDestDistrictName(),mgoodsSourcePkace.getDestDetailAddress(),null,false, R.mipmap.icon_unload_goods,handleTypeNo,2));
        }else if ("22".equals(handleTypeNo)){
            list.add(new AddressItem(mgoodsSourcePkace.getProvinceName()+"  "+mgoodsSourcePkace.getCityName()+"  "+mgoodsSourcePkace.getDistrictName(),mgoodsSourcePkace.getDetailAddress(),mgoodsSourcePkace.getFirstDistance(),true, R.mipmap.icon_load_one,handleTypeNo,0));
            list.add(new AddressItem(mgoodsSourcePkace.getViaSendProvinceName()+"  "+mgoodsSourcePkace.getViaSendCityName()+"  "+mgoodsSourcePkace.getViaSendDistrictName(),mgoodsSourcePkace.getViaSendDetailAddress(),mgoodsSourcePkace.getSecondDistance(),true, R.mipmap.icon_load_two,handleTypeNo,1));
            list.add(new AddressItem(mgoodsSourcePkace.getViaDestProvinceName()+"  "+mgoodsSourcePkace.getViaDestCityName()+"  "+mgoodsSourcePkace.getViaDestDistrictName(),mgoodsSourcePkace.getViaDestDetailAddress(),mgoodsSourcePkace.getThirdDistance(),true, R.mipmap.icon_unload_one,handleTypeNo,2));
            list.add(new AddressItem(mgoodsSourcePkace.getDestProvinceName()+"  "+mgoodsSourcePkace.getDestCityName()+"  "+mgoodsSourcePkace.getDestDistrictName(),mgoodsSourcePkace.getDestDetailAddress(),null,false, R.mipmap.icon_unload_two,handleTypeNo,3));
        }
    }

    private void setVehicleRq(GoodsSourceDetail goodsSourceDetail,BaseViewHolder helper){
        helper.setVisible(R.id.ll_vehicle_type,goodsSourceDetail.isBidding()?false:true);
        helper.setText(R.id.model_text,goodsSourceDetail.getCarTypeName());
        helper.setText(R.id.driver_text,goodsSourceDetail.getCarLenName());
        helper.setText(R.id.column_height_text,TextUtils.isEmpty(goodsSourceDetail.getHeightHurdle())?"/":NumberUtil.trim0(goodsSourceDetail.getHeightHurdle())+"米");
        helper.setText(R.id.vehicle_type_text, CargoConstant.getTransportTypeStr(goodsSourceDetail.getTransportType()));
        helper.setText(R.id.unload_text,goodsSourceDetail.getIsDump()==null?"/":goodsSourceDetail.getIsDump()==1?"自卸":"非自卸");
        SeeMoreView transport_requirements_text = helper.getView(R.id.transport_requirements_text);
        transport_requirements_text.setText(TextUtils.isEmpty(goodsSourceDetail.getNote())?"/":DefaultUtil.getString(goodsSourceDetail.getNote()));

    }
    private void setFreightRq(GoodsSourceDetail goodsSourceDetail,BaseViewHolder helper){
        helper.setText(R.id.transport_goods_text,TextUtils.isEmpty(goodsSourceDetail.getGoodsTypeName())?"/":goodsSourceDetail.getGoodsTypeName());
        helper.setText(R.id.loading_requirements_text,TextUtils.isEmpty(goodsSourceDetail.getloadRequireWords())?"/":goodsSourceDetail.getloadRequireWords());
        helper.setText(R.id.packaging_mode_text,TextUtils.isEmpty(goodsSourceDetail.getPackingModeName())?"/":goodsSourceDetail.getPackingModeName());
        helper.setText(R.id.unloading_requirement_text,TextUtils.isEmpty(goodsSourceDetail.getUnloadRequireWords())?"/":goodsSourceDetail.getUnloadRequireWords());
        if (goodsSourceDetail.isBidding()){
            helper.setText(R.id.loading_time_text,goodsSourceDetail.getShipmentTime()==null||goodsSourceDetail.getShipmentEndTime()==null?"/":DateUtils.stampToDay5(goodsSourceDetail.getShipmentTime() + "")+"-"+DateUtils.stampToDay5(goodsSourceDetail.getShipmentEndTime() + ""));
        }else {
            if (goodsSourceDetail.getShipmentTime()==null){
                helper.setText(R.id.loading_time_text,"/");
                return;
            }
            if (CargoConstant.stampFormatLoadInput(goodsSourceDetail.getShipmentTime(),goodsSourceDetail.getStartPointTime()).equals(CargoConstant.stampFormatLoadInput(goodsSourceDetail.getShipmentEndTime(),goodsSourceDetail.getEndPointTime()))){
                helper.setText(R.id.loading_time_text,CargoConstant.stampFormatLoadInput(goodsSourceDetail.getShipmentTime(),goodsSourceDetail.getStartPointTime()));
            }else {
                helper.setText(R.id.loading_time_text, CargoConstant.stampFormatLoadInput(goodsSourceDetail.getShipmentTime(),goodsSourceDetail.getStartPointTime())+(TextUtils.isEmpty(CargoConstant.stampFormatLoadInput(goodsSourceDetail.getShipmentEndTime(),goodsSourceDetail.getEndPointTime()))?"":"-")+ CargoConstant.stampFormatLoadInput(goodsSourceDetail.getShipmentEndTime(),goodsSourceDetail.getEndPointTime()));
            }
          //  helper.setText(R.id.loading_time_text,goodsSourceDetail.getShipmentTime()==null||goodsSourceDetail.getShipmentEndTime()==null?"/":DateUtils.stampToDay5(goodsSourceDetail.getShipmentTime() + "")+"-"+DateUtils.stampToDay5(goodsSourceDetail.getShipmentEndTime() + ""));
        }
        helper.setText(R.id.arrival_time_text,goodsSourceDetail.getArrivalTime()==null?"/":"开始运输后"+goodsSourceDetail.getArrivalTime()+"天内");
        SeeMoreView moreView = helper.getView(R.id.damage_to_goods_text);
        moreView.setText(TextUtils.isEmpty(goodsSourceDetail.getLostPromise())?"/":DefaultUtil.getString(goodsSourceDetail.getLostPromise()));
        if (TextUtils.isEmpty(goodsSourceDetail.getPerformanceBond())){
            helper.setText(R.id.security_deposit_text,"/");
            helper.setTextColor(R.id.security_deposit_text,helper.itemView.getResources().getColor(R.color.color_tab_one));
        }else {
            if ("0".equals(NumberUtil.trim0(goodsSourceDetail.getPerformanceBond()))){
                helper.setTextColor(R.id.security_deposit_text,helper.itemView.getResources().getColor(R.color.color_tab_one));
            }
            helper.setText(R.id.security_deposit_text,"0".equals(NumberUtil.trim0(goodsSourceDetail.getPerformanceBond()))?"/":NumberUtil.trim0(goodsSourceDetail.getPerformanceBond())+"元");
        }
        SeeMoreView breach_of_contract_text = helper.getView(R.id.breach_of_contract_text);
        breach_of_contract_text.setText(TextUtils.isEmpty(goodsSourceDetail.getOverduePromise())?"/":DefaultUtil.getString(goodsSourceDetail.getOverduePromise()));
        SeeMoreView other_agreements_text = helper.getView(R.id.other_agreements_text);
        other_agreements_text.setText(TextUtils.isEmpty(goodsSourceDetail.getOtherPromise())?"/":DefaultUtil.getString(goodsSourceDetail.getOtherPromise()));
        showDiyInfo(goodsSourceDetail,helper);
    }
    private void setPaymentAgrement(GoodsSourceDetail goodsSourceDetail,BaseViewHolder helper){
        helper.setText(R.id.payment_method_text,TextUtils.isEmpty(goodsSourceDetail.getPayType())?"/":goodsSourceDetail.getPayType());
        helper.setText(R.id.collection_requirement_text,TextUtils.isEmpty(goodsSourceDetail.getReceiptAccountRequire())?"/":DefaultUtil.getString(goodsSourceDetail.getReceiptAccountRequire()));
        helper.setText(R.id.invoice_requirement_text,TextUtils.isEmpty(goodsSourceDetail.getInvoiceWords())?"/":goodsSourceDetail.getInvoiceWords().equals("不开发票") ? goodsSourceDetail.getInvoiceWords():
                NumberUtil.trim0(goodsSourceDetail.getTariff()) + "%" + goodsSourceDetail.getInvoiceWords());

        StringBuilder builder = new StringBuilder();
        if (!TextUtils.isEmpty(goodsSourceDetail.getPrepaidProportion()) && !goodsSourceDetail.getPrepaidProportion().equals("0")) {
            builder.append("预付款").append(goodsSourceDetail.getPrepaidProportion()).append("%，");
        }
        if (goodsSourceDetail.getPaymentAfterLoading() != 0) {
            builder.append("装车后支付").append(goodsSourceDetail.getPaymentAfterLoading()).append("%，");
        }
        if (goodsSourceDetail.getArrivalAcceptancePayment() != 0) {
            builder.append("到货验收后支付").append(goodsSourceDetail.getArrivalAcceptancePayment()).append("%（尾款由验收人验收后支付），");
        }
        if (builder.length() > 1) {
            helper.setText(R.id.gtd_payment_method_text_ax, builder.substring(0, builder.length() - 1));
            helper.setVisible(R.id.gtd_payment_method_text_ax, true);
        } else {
            helper.setVisible(R.id.gtd_payment_method_text_ax, false);
        }
        SeeMoreView other_payment_requirements_text = helper.getView(R.id.other_payment_requirements_text);
        other_payment_requirements_text.setText(TextUtils.isEmpty(goodsSourceDetail.getOtherPaymentRequire())?"/":goodsSourceDetail.getOtherPaymentRequire());
        helper.setText(R.id.unit_name_text,TextUtils.isEmpty(goodsSourceDetail.getInvoicingCompanyName())?"/":goodsSourceDetail.getInvoicingCompanyName());
        helper.setText(R.id.tax_number_text,TextUtils.isEmpty(goodsSourceDetail.getInvoicingTaxNumber())?"/":goodsSourceDetail.getInvoicingTaxNumber());
        helper.setText(R.id.address_text,TextUtils.isEmpty(goodsSourceDetail.getInvoicingAddress())?"/":goodsSourceDetail.getInvoicingAddress());
        helper.setText(R.id.corporate_phone_text,TextUtils.isEmpty(goodsSourceDetail.getInvoicingCompanyPhone())?"/":goodsSourceDetail.getInvoicingCompanyPhone());
        helper.setText(R.id.bank_of_deposit_text,TextUtils.isEmpty(goodsSourceDetail.getInvoicingBank())?"/":goodsSourceDetail.getInvoicingBank());
        helper.setText(R.id.account_number_text,TextUtils.isEmpty(goodsSourceDetail.getInvoicingBankNumber())?"/":goodsSourceDetail.getInvoicingBankNumber());
        helper.setText(R.id.bank_number_text,TextUtils.isEmpty(goodsSourceDetail.getInvoicingBankNumber())?"/":goodsSourceDetail.getInvoicingBankNumber());

    }
    /**
     * 新增字段显示隐藏操作
     */
    private void showDiyInfo(GoodsSourceDetail info,BaseViewHolder helper) {
        View[] layoutArray = {helper.getView(R.id.diy_content_layout1), helper.getView(R.id.diy_content_layout2), helper.getView(R.id.diy_content_layout3)};
        TextView[] diyFiledKeyArray = {helper.getView(R.id.diy_name1), helper.getView(R.id.diy_name2), helper.getView(R.id.diy_name3)};
        SeeMoreView[] diyFiledValueArray = {helper.getView(R.id.diy_value1), helper.getView(R.id.diy_value2), helper.getView(R.id.diy_value3)};
        if (info.getDiyField() == null || info.getDiyField().size() == 0) {
            return;
        }
        //因为这里限制了最多三条，所以在这里添加一个保护
        if (info.getDiyField().size() > 3) {
            info.setDiyField(info.getDiyField().subList(0, 3));
        }
        for (int i = 0; i < info.getDiyField().size(); i++) {
            layoutArray[i].setVisibility(View.VISIBLE);
            diyFiledKeyArray[i].setText(info.getDiyField().get(i).getKey());
            CharSequence styledText = Html.fromHtml(DefaultUtil.getString((info.getDiyField().get(i).getValue())));
            diyFiledValueArray[i].setText(DefaultUtil.getString(styledText.toString()));
        }
    }

    @Override
    public void onItemClick(GoodsSourcePlace place, String typeNo,int position) {
        mItemOnClickListen.onItemClick(place,typeNo,position);
        company=mGoodsSourceDetail.getTerminal()==3?"":mGoodsSourceDetail.getCompanyName();
        //TODO 去地图查看界面
        switch (typeNo){
            case "11":
                HandleAdressActivity.start(mContext,mGoodsSourceDetail.getContrcts(),company,mGoodsSourceDetail.getContrctsNumber(),mGoodsSourceDetail.getImAccount(),mGoodsSourceDetail.getPlace(),position,"11");
                break;
            case "12":
                HandleAdressActivity.start(mContext,mGoodsSourceDetail.getContrcts(),company,mGoodsSourceDetail.getContrctsNumber(),mGoodsSourceDetail.getImAccount(),mGoodsSourceDetail.getPlace(),position,"12");
                break;
            case "21":
                HandleAdressActivity.start(mContext,mGoodsSourceDetail.getContrcts(),company,mGoodsSourceDetail.getContrctsNumber(),mGoodsSourceDetail.getImAccount(),mGoodsSourceDetail.getPlace(),position,"21");
                break;
            case "22":
                HandleAdressActivity.start(mContext,mGoodsSourceDetail.getContrcts(),company,mGoodsSourceDetail.getContrctsNumber(),mGoodsSourceDetail.getImAccount(),mGoodsSourceDetail.getPlace(),position,"22");
                break;
        }

    }
    String company;
    public interface ItemOnClickListen {
        void onItemClick(GoodsSourcePlace place,String i,int position);

    }
    private void initBiddingView(BaseViewHolder helper,boolean isOwner) {
        mBiddingUnitAdapter = new BiddingUnitAdapter(mList,isOwner,0);
        RecyclerView recyclerView = helper.itemView.findViewById(R.id.rv_info);
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        mBiddingUnitAdapter.bindToRecyclerView(recyclerView);
        if (ArrayUtil.isNullOrEmpty(mList)) {
            View empty = LayoutInflater.from(mContext).inflate(R.layout.layout_logistics_null_list, recyclerView, false);
            mBiddingUnitAdapter.setEmptyView(empty);
        }
    }


}
